<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    // let state = "show";
    // if(state === "show"){
    //     show();
    // }else if(state === "hide"){
    //     hide();
    // }


    let state = "small";
    const obj = {
        small(){
            console.log("small的功能");
        },
        middle(){
            console.log("middle的功能");
        },
        large(){
            console.log("large的功能");
        },
        // ...
    }
    obj[state]();
    
</script>
</html>